﻿using System.Windows;

namespace Builderator.Firefly.Controls
{
    /// <summary>
    /// Interaction logic for UserInputControl.xaml
    /// </summary>
    public partial class UserInputWindow : Window
    {
        public string UserInput
        {
            get;
            set;
        }

        public UserInputWindow()
        {
            InitializeComponent();
        }

        public UserInputWindow(string description, string title)
            : this()
        {
            this.Title = title;

            this.descriptionTextBlock.Text = description;
        }

        private void userInputTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            this.UserInput = this.userInputTextBox.Text;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;

            e.Handled = true;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.userInputTextBox.Focus();
        }
    }
}
